import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';

import 'package:get/get.dart';
import 'package:xmshop/app/modules/productContent/controllers/product_content_controller.dart';
import 'package:xmshop/app/serives/screenAdapter.dart';

class SecondPageViewView extends GetView {
  @override
  final ProductContentController controller = Get.find();

  final Function _subHeader;

  SecondPageViewView(this._subHeader, {Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
      key: controller.gk2,
      width: ScreenAdapter.width(1080),
      color: Colors.white,
      child: Obx(() => controller.pcontent.value.content != null
          ? Column(
              children: [
                _subHeader(),
                controller.selectedSubTabsIndex.value == 1
                    ? SizedBox(
                        width: ScreenAdapter.width(1080),
                        child: Html(
                          data: controller.pcontent.value.content,
                          style: {
                            "body": Style(backgroundColor: Colors.white),
                            "p": Style(fontSize: FontSize.large)
                          },
                        ),
                      )
                    : SizedBox(
                        width: ScreenAdapter.width(1080),
                        child: Html(
                          data: controller.pcontent.value.specs,
                          style: {
                            "body": Style(backgroundColor: Colors.white),
                            "p": Style(fontSize: FontSize.large)
                          },
                        ),
                      )
              ],
            )
          : const Text("")),
    );
  }
}
